﻿using System;
using System.Collections.Generic;
using IsolationLevel = System.Transactions.IsolationLevel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BDShop.DAL;
using BDShop.Entities;

namespace BDShop.Business
{
    public class ProductRelatedService
    {
        public static List<ProductRelated> GetByID(long id)
        {
            List<ProductRelated> productRelated = new List<ProductRelated>();
            using (var context = new BDShopEntities(IsolationLevel.ReadUncommitted))
            {
                productRelated = context.ProductRelates.Where(p => p.ProductID == id).ToList();
            }

            return productRelated;
        }
    }
}
